﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="SettingClassEval.aspx.cs" Inherits="Credit_Teacher_RuleSettings_SettingClassEval" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>设置德育评价</title>
     <link href="../../Common/css/main.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        .noneClick {
            cursor: default;
        }
    </style>

    <script type="text/javascript" src="../../Common/js/jquery.js"></script>

    <script type="text/javascript" src="../../Common/js/common.js"></script>
    
    <script type="text/javascript" src="../../Common/js/jsUtil.js"></script>
    
    <script type="text/javascript">
var currHistoryId = 0; //当前编辑状态的学分评估id
var currEvalType =2;
var currCauseId = 0;//当前学科id
var currTypeId = 0;
var currTypeName = '';
var typeArray = new Array();
var delArr = new Array();
var type=2;
var stateType=1;
 
//----------------------------------------------------------------------------------------------添加 
function AddRow()
{
    if(satateType == "1") {
        showMassgeBox("提示",'此规则已经确认, 不能进行修改.',1,null);
        return;
    }

    if(currTypeId ==0)
    {
        showNoticMsg('btnAddItem','请先确定要添加项的科目类型',-60,10); 
        return;
    }
    if(document.getElementById('table') != null)
    {
        var table = document.getElementById('table');
        document.getElementById('btnAddItem').disabled= true ;
        document.getElementById('btnSaveItem').disabled= true ;
        
        var row = table.insertRow();
        row.setAttribute("typeid",currTypeId);
     
        var td =   row.insertCell();   
        td.style.textAlign = "left";
        td.style.paddingLeft = "5px";
        td.innerHTML = "<input id='newItemName' maxLength='20' style='text-align:left;border:solid #a5a5a5 1px;width:95%'  font-weight:inherit;color:#006f9f;"+
                       " font-style:inherit; "+
                       " font-size:12px;"+
                       " font-family:'SimSun', Arial, Helvetica, sans-serif;' "+
                       " onpaste='return false;' ondragenter='return false' value='<请输入名称>'  onblur=\"AddOne(this)\" \>";
        
        td = row.insertCell();
        td.innerHTML = "<select onclick='FilterCount();'><option value='1'>计分</option>"+
                      "<option value='2'>计次</option></select>";
        
        td = row.insertCell();
        td.innerHTML = "<select style='display:none;'><option value='1'>加分</option> "+
                      "<option value='-1'>减分</option></select>";
        
        td = row.insertCell();
        td.innerHTML = " <input onkeypress='return (event.keyCode>=48&&event.keyCode<=57)||event.keyCode==46;' onpaste='return false;'" +
                   "ondragenter='return false;' maxlength='4' class='txtStyle' style='text-align: right;"+
                   "border-left: 0px; width: 98%; border-top: 0px; border-right: 0px; border-bottom: 0px;"+
                   " font-weight:inherit;color:#006f9f;"+
                   " font-style:inherit;"+
                   " font-size:12px;"+
                   " font-family:'SimSun', Arial, Helvetica, sans-serif;'"+
                   " onfocusout='optionSettingScore(this)' onclick='modi(this)' value='0' readonly />";
        
        td = row.insertCell(); 
        td.innerHTML = "<a><img src='../../../Common/images/delete_icon.gif' onclick='DelRow(this.parentElement.parentElement.parentElement)'/></a>"        
        
        document.getElementById('newItemName').select();
    }
}

function AddOne(obj)
{
    if(satateType == "1") {
        showMassgeBox("提示",'此规则已经确认, 不能进行修改.',1,null);
        return;
    }

    var settingName = obj.value.Trim();
    var rowIndex = obj.parentElement.parentElement.rowIndex;

    var settingTable = document.getElementById('table');
    settingTable.rows(rowIndex).cells(0).innerHTML = "<input  maxlength='20' class='txtStyle' style='text-align: left; border-left: 0px; width:120px;border-top: 0px; border-right: 0px; border-bottom: 0px;'"+
                                        " font-style:inherit; "+
                                        " font-size:12px;"+
                                        " font-family:'SimSun', Arial, Helvetica, sans-serif;' "+
                                        " id='n"+settingName+
                                        "' value='"+settingName+"' oldvalue='"+settingName+"' onfocusout='optionSettingProject(this)' onclick='modi(this)'  onpaste='return false;' ondragenter='return false' readonly>";
                                                    
   settingTable.rows(rowIndex).cells(4).innerHTML = "<a><img src='../../../Common/images/delete_icon.gif' onclick='DelRow(this.parentElement.parentElement.parentElement)'/></a>"        ;
    if(settingName == null || settingName.length == 0 || settingName == '<请输入名称>' )
    {        
        settingTable.deleteRow(rowIndex);
    }
    else
    {
        settingTable.rows(rowIndex).id = "null"; 
        settingChange = true;
    }
    document.getElementById('btnAddItem').disabled= false ;
    document.getElementById('btnSaveItem').disabled= false ;

}

//----------------------------------------------------------------------------------添加类型
function AddType()
{
    if(satateType == "1") {
        showMassgeBox("提示",'此规则已经确认, 不能进行修改.',1,null);
        return;
    }

    var name = document.getElementById('txtTypeName').value.Trim();
    if(name != null && name.length > 0)
    {
        var num = null;
        //验证类型名
        PageMethods.ValidateTypeName(currHistoryId,name,function(succ){
            num = succ; 
            if(num > 0)
            {

                showNoticMsg('txtTypeName','类型名已被使用，请重新输入'); 
                return;
            }
            else
            {
                //添加类型 已存在hsitoryid的
                PageMethods.AddType(currHistoryId,name,function(succ){
                if(succ > 0)
                {
                    showMassgeBox("提示",'添加成功',1,null);
                    CloseMask('popTable');
                    TypeBind();
                }
                else
                {
                    showMassgeBox("提示",'添加失败',1,null);
                }
            
                },function(err){
                  showMassgeBox("提示",err._message,1,null);
                });
            }
        },function(err){
          showMassgeBox("提示",err._message,1,null);
        });             
    }
    else
    {
        showNoticMsg('txtTypeName','类型名不能为空',-100,10); 
    }
}


//----------------------------------------------------------------------------------------删除
function DelRow(row)
{
    if(satateType == "1") {
        showMassgeBox("提示",'此规则已经确认, 不能进行修改.',1,null);
        return;
    }

    var table = document.getElementById('table');  
    if(table != null && row.rowIndex > 0)
    {
        table.deleteRow(row.rowIndex);
        if(row.itemid != null)
        {
            var len = delArr.length;

            delArr[len] = {HistoryID:0,TypeID:0,RID:parseInt(row.itemid),Caption:'',Type:0,Operator:0,Param:0};
        }
    }
}  
  
//弹出删除窗口  
function ShowDelWindow()
{
    if(satateType == "1") {
        showMassgeBox("提示",'此规则已经确认, 不能进行修改.',1,null);
        return;
    }

    if(currTypeId > 0)
    {
        showConfirmBox("删除", "确定删除此类型?", DelType, currTypeId);
    }
    else
    {
        showNoticMsg('picDel','您还未选择要删除的类型',-20,10); 
    }
}

//删除类型
function DelType(typeId)
{
    if(typeId > 0)
    {
        PageMethods.DelTypeById(currHistoryId,typeId,function(succ){
            if(succ > 0)
            {
                showMassgeBox("提示",'删除成功',1,null);
                TypeBind();
            }
            else
            {
                showMassgeBox("提示",'删除失败',1,null);
            }
        },function(err){
          showMassgeBox("提示",err._message,1,null);
        });     
    }
}  
  
  
//------------------------------------------------------------------------------------------------修改 
function ShowUpdateWindow()
{
    if(satateType == "1") {
        showMassgeBox("提示",'此规则已经确认, 不能进行修改.',1,null);
        return;
    }

    if(currTypeId > 0)
    {
        document.getElementById('txtTypeName2').value = currTypeName;
        ShowPopForm("popTable2", "formTitle", "修改类型");
        showMask();
        document.getElementById('txtTypeName2').focus();
    }
    else
    {
        showNoticMsg('picUpdate','您还未选择要修改的类型',-20,10); 
    }
}   
  
function UpdateType()
{
    if(satateType == "1") {
        showMassgeBox("提示",'此规则已经确认, 不能进行修改.',1,null);
        return;
    }

    var name = document.getElementById('txtTypeName2').value;
    if(currTypeName == name) {
        CloseMask('popTable2');
    }
    
    if(name != null && name.length > 0)
    {
        var num = null;
        //验证类型名
        PageMethods.ValidateTypeName(currHistoryId,name,function(succ){
            num = succ; 
            if(num > 0)
            {
                showNoticMsg('txtTypeName2','类型名已被使用，请重新输入',-100,10); 
                return;
            }
            else
            {
                 PageMethods.UpdateType(currTypeId,name,function(succ){
                    if(succ > 0)
                    {
                        showMassgeBox("提示",'修改成功',1,null);
                        CloseMask('popTable2');
                        TypeBind();
                    }
                    else
                    {
                        showMassgeBox("提示",'修改失败',1,null);
                    }
                },function(err){
                  showMassgeBox("提示",err._message,1,null);
                }); 
            }
         },function(err){
              showMassgeBox("提示",err._message,1,null);
         }); 
    
   }
}
  
//-------------------------------------------------------------------------------------------------保存  
function Save()
{
    if(satateType == "1") {
        showMassgeBox("提示",'此规则已经确认, 不能进行修改.',1,null);
        return;
    }
    var arr = new Array();
    var table = document.getElementById('table');
    if(table != null)
    {
        for(var i=1;i<table.rows.length;i++)
        {
            var row = table.rows[i];
           
            var itemCaption = row.cells[0].all[0].value;
            var itemType = Number(row.cells[1].all[0].value);
            var itemOperator =  Number(row.cells[2].all[0].value); 
            var itemParam =  Number(row.cells[3].all[0].value);  
            var typeId = 0,itemId = 0;
 
            typeId = Number(currTypeId);
            if(row.itemid != null)
                itemId = row.itemid;
         
            arr[i-1] = {HistoryID:currHistoryId,TypeID:typeId,RID:itemId,Caption:itemCaption,Type:itemType,Operator:itemOperator,Param:itemParam};
       }
       
       PageMethods.SaveCauseEvalItem(arr,delArr,function(succ){
            if(succ > 0)
            {
              showMassgeBox("提示","操作成功",1,null);
//              TypeBind();
            }
        },function(err){
            showMassgeBox("提示",err._message,1,null);
        }); 
    }  
}  



//----------------------------------------------------------------------------弹出添加类型遮罩层
function ShowAddWindow()
{
    if(satateType == "1") {
        showMassgeBox("提示",'此规则已经确认, 不能进行修改.',1,null);
        return;
    }

    document.getElementById('txtTypeName').value = "";
   
    ShowPopForm("popTable", "formTitle", "添加类型");
    showMask();
    document.getElementById('txtTypeName').focus();
}

 //关闭遮罩层
function CloseMask(formId)
{
    ClosePopForm(formId,true);
    hideMask();
}
  
////---------------------------------------------------------------------------其他设置    
 function optionSettingScore(obj)
{
    s=true;
    //var id = obj.parentElement.parentElement.id;
//    var value = obj.value;
//    if(value.length == 0 ||  ( /\D/.test(value)))
//    {   
//        obj.setAttribute("value",obj.getAttribute("oldvalue")); 
//        value = obj.value;
//        
//    }
//    else
//    {
////        if(Number(value) > 10)
////            value = 10;
//        obj.value = Number(value);
//        value = obj.value;
//    }
//    
//    unModi(obj,'right');
//}
var id = obj.parentElement.parentElement.id;
        var value = obj.value;

        if( value.search(/^(-|\+)?\d+(\.\d+)?$/)==-1)
        {   

            if(value.length >0 && value.charAt(value.length-1)==".")
            {
                value = value.substr(0,value.length-1);
                if( value.search(/^(-|\+)?\d+(\.\d+)?$/)==-1)
                {
 
                    obj.setAttribute("value",obj.getAttribute("oldvalue")); 
                }
                else
                {
                    if(CheckCh(value))
                    {
                        obj.setAttribute("value",value); 
                        obj.setAttribute("oldvalue",value); 
                    }
                    else
                    {
                        obj.setAttribute("oldvalue",value); 
                    }
                    
                }
            }
            else
            {
                if(value.length == 0 ||  ( /\D/.test(value)))
                {   
                    obj.setAttribute("value",obj.getAttribute("oldvalue")); 
                }
                else
                {
                    obj.setAttribute("value",value); 
                    obj.setAttribute("oldvalue",value); 
                }
            }
           
        }
        else
        {
            obj.setAttribute("oldvalue",value); 
        }

    unModi(obj,'right');
}
    function CheckCh(avalue)
    {
        for   (n=0;   n<avalue.length;   n++) 
        {  
            if   (avalue[n]>128)//   中文字符
            {
                return false;
            }
        }
        return true;
    }
function optionSettingProject(obj)
{
    s=true;
    //var id = obj.parentElement.parentElement.id;
    var value = obj.value;

    if(value.length == 0)
    { 
        obj.setAttribute("value",obj.getAttribute("oldvalue")); 
        value = obj.value;
    }
    else
    {
        obj.value = value;
        value = obj.value;
    }
    
    unModi(obj,'left');
}
//编辑状态
function modi(obj)
{ 
    if(satateType == "1")
        return;

    if( obj.readOnly == true)
    {
     //   obj.parentElement.style.textAlign = 'center';
        obj.style.textAlign = 'left';  
        obj.style.border = 'solid #a5a5a5 1px;';   
        obj.readOnly = false;   
        obj.select();
        updateActivate = 1; 
    }
}
  //非编辑状态
function unModi(obj,align)
{
    if(obj.readOnly == false)
    {
       obj.parentElement.style.textAlign = align;
       obj.style.textAlign = align;  
       obj.style.border = 'solid #ffffff 1px;';   
       obj.readOnly = true; 
       updateActivate = 0;   
    }
}
//选中行高亮
function SetHightLight(obj)
{
    if(obj != null) 
        obj.style.backgroundColor = "#fffccf";
        
    var table = document.getElementById('table');
    for(var i =0 ; i < table.rows.length;i++)
    {
        var row = table.rows[i];
        if(row != null && row.rowIndex != obj.rowIndex)
        {
            row.style.backgroundColor = "#ffffff";
        }
    }
    
    
//    currHistoryId = obj.itemid;
} 

function FilterCount()
{
    var value = event.srcElement.value;
    var table = document.getElementById('table');
    var rowIndex = event.srcElement.parentElement.parentElement.rowIndex;
    var row = table.rows[rowIndex];
    if(value == 1)
    {
        row.cells[2].all[0].style.display  = "none"; 
     //   row.cells[3].all[0].style.display = "none"; 
    }
    else
    {
        row.cells[2].all[0].style.display  = "block"; 
     //   row.cells[3].all[0].style.display  = "block"; 
    }
}
 

//----------------------------------------------------------------------------------Type导航
function leftNav(obj) 
{
    removeActiveStyle();
    obj.parentNode.className = "active";
    currTypeId = obj.id;
    currTypeName = obj.innerText;
    
    document.getElementById('txtTypeId').value = currTypeId;
    document.getElementById('txtHistoryId').value = currHistoryId;
    document.getElementById('txtCauseId').value = currCauseId;
    document.getElementById('btnItemBind').click();
}
/**
 移除active样式
*/
function removeActiveStyle() {
    var liList = document.getElementsByTagName("li");
    for (var i=0; i<liList.length; i++) {
        liList[i].className = "";
    }
}

function GetSelected(value,targetValue)
{ 
    if(value == targetValue)
        return "selected"
    else
        return "";
}


//---------------------------------------------------------------绑定方法
//function TypeBind()
//{
////    document.getElementById('txtTypeName').value = "";
// 
//    document.getElementById('txtHistoryId').value = currHistoryId;
//    document.getElementById('txtCauseId').value = currCauseId;
//    document.getElementById('txtTypeId').value = currTypeId;
////    document.getElementById('btnTypeBind').click();
// document.getElementById('btnTypeBind').click();
//}

function ItemBind()
{

}
 
function TypeBind() 
{
    satateType = request("state");

    delIds = new Array();
    if(currCauseId > 0)
    {
        PageMethods.GetTypeListByCauseId(currHistoryId,function(succ){
           var ul = document.getElementById('ul');
            var selectItem = null;
            ul.innerHTML = "";
            if(succ.length > 0)
            {
                var str = ""; 
                if(ul != null)
                {
                    var clickLi = null;
                    for(var i =0;i < succ.length;i++)
                    {
                        var item = succ[i]; 
                        var li = document.createElement("LI");
                        li.setAttribute("class","");
                        li.innerHTML = "<a href=\"#\" onclick='leftNav(this)' id="+item.RID+">"+item.Caption+"</a>";

                        if(currTypeId > 0 && item.RID == currTypeId)
                        {
                             selectItem = li;
                        }    
                        if(i==0)
                            clickLi = li;
                        ul.appendChild(li);
                    }
                    
                    if(selectItem != null)
                    {
                        selectItem.all[0].click(); 
                    }
                    else
                    {
                        if(clickLi != null)
                            clickLi.all[0].click(); 
                    }
                }
            }
            else
            {
                currTypeId = 0;
                currTypeName = "";
                
                //没有一个type的情况下
               var table = document.getElementById('table');
               if(table != null)
               {
                    for(var i =table.rows.length ;i >1;i--)
                    {
                        var row = table.rows[i-1];
                        table.deleteRow(row.index);
                    }
               }
                
            } 
        },function(err){
          showMassgeBox("提示",err._message,1,null);
        }); 
     }
}   
    </script>
    
</head>
<body onload="TypeBind();">
    <div style="overflow-y: auto; overflow-x: none; height: 98%;">
        <form id="form1" runat="server">
            <div class="mainWarp">
                <div class="pageBody" style="height: 96%;">
                    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true">
                    </asp:ScriptManager>
                    
                   <div style=" float:left;height: 98%; width:150px;padding-top:10px;">
                       <ul class="butList">
                            <li>
                              
                                <img id="picAdd" src="../../Common/images/add_icon.gif" alt="添加类别" onclick="ShowAddWindow();"/>
                                <img id="picUpdate" src="../../Common/images/hadle_icon.gif" alt="修改类别" onclick="ShowUpdateWindow();"/>
                                <img id="picDel" src="../../Common/images/minus_icon.gif" alt="删除类别" onclick="ShowDelWindow();"/>
                            </li>
                        </ul>
                        <div class="menuBody">
                        <div class="menuList">
                            <dl>
                                <ul id="ul">
                                
                                </ul>
                            </dl>
                        </div>
                        </div>
                   </div>
                    <div style=" float:left;height: 98%;">
                        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                            <ContentTemplate>
                                <ul class="butList">
                                            <li>
                                                <input type="button" value="新增" class="commonBut" id="btnAddItem" onclick="AddRow();" />
                                                <input type="button" value="保存" class="commonBut" id="btnSaveItem" onclick="Save();" />
                                            </li>
                                          </ul>  
                                  
                                        
                                    <div style="overflow-y: auto; overflow-x: none; height: 90%;">
                                        <table id="table" class="useList" style="width: 95%">
                                            <tr >
                                                <th style="text-align: left; padding-left: 5px; width:25%;">
                                                    项目</th>
                                                <th >
                                                    评分方式</th>
                                                <th >
                                                    奖罚方式</th>
                                                <th style="text-align: right; padding-right: 5px;">
                                                    分值</th>
                                                <th style="width: 10%">
                                                    删除</th>
                                            </tr>
                                    <asp:Repeater ID="Repeater1" runat="server">
                                        <ItemTemplate> 
                                            <tr onclick="SetHightLight(this);" itemid="<%#Eval("RID") %>" typeid="<%#Eval("TypeId") %>">
                                                <td style="text-align: left; padding-left: 5px;"> 
                                                    <input  onpaste="return false;"
                                                    ondragenter="return false" maxlength="20" class="txtStyle" style='text-align: left;
                                                    border-left: 0px; width: 98%; border-top: 0px; border-right: 0px; border-bottom: 0px;
                                                    font-weight:inherit;color:#006f9f;
                                                    font-style:inherit;
                                                    font-size:12px;
                                                    font-family:'SimSun', Arial, Helvetica, sans-serif;'
                                                    id="Text6" value="<%#Eval("Caption") %>" oldvalue="<%#Eval("Caption") %>"
                                                    onfocusout="optionSettingProject(this)" onclick="modi(this)" readonly />
                                                 </td>
                                                 <td>
                                                    <select onclick="FilterCount();">
                                                        <%# GetTypeOpt((int)Eval("Type")) %> 
                                                    </select>
                                                </td>
                                                <td>
                                                    <select style="display:<%# GetDisplay((int)Eval("Type")) %>">
                                                        <%# GetOperatorOpt((int)Eval("Operator")) %>
                                                    </select>
                                                </td>
                                                <td style=" text-align:right; padding-right:5px;">
                                                    <input onkeypress="return (event.keyCode>=48&&event.keyCode<=57)||event.keyCode==46;" onpaste="return false;"
                                                    ondragenter="return false" maxlength="4" class="txtStyle" style='text-align: right; 
                                                    border-left: 0px; width: 98%; border-top: 0px; border-right: 0px; border-bottom: 0px;
                                                    font-weight:inherit;color:#006f9f;
                                                    font-style:inherit;
                                                    font-size:12px;
                                                    font-family:'SimSun', Arial, Helvetica, sans-serif;'
                                                    id="Text1" value="<%# Eval("Param")%>" oldvalue="<%# Eval("Param")%>"
                                                    onfocusout="optionSettingScore(this)" onclick="modi(this)" readonly />
                                                </td>
                                                <td><a><img src="../../../Common/images/delete_icon.gif" onclick="DelRow(this.parentElement.parentElement.parentElement)"/></a></td>
                                            </tr>
                                    </ItemTemplate>
                                  </asp:Repeater> 
                                </table>
                             </div> 
                               </ContentTemplate>
                                <Triggers>
                                    <asp:AsyncPostBackTrigger ControlID="btnTypeBind" EventName="Click" />
                                    <asp:AsyncPostBackTrigger ControlID="btnItemBind" EventName="Click" />
                                </Triggers>
                            </asp:UpdatePanel>
                            <%--服务器端控件层--%>
                            <div style="display: none;">
                                <asp:Button runat="server" ID="btnTypeBind" OnClick="btnTypeBind_Click" />
                                <asp:Button runat="server" ID="btnItemBind" OnClick="btnItemBind_Click"  />
                                
                                <asp:TextBox runat="server" id="txtHistoryId" />
                                <asp:TextBox runat="server" id="txtCauseId" /> 
                                  <asp:TextBox runat="server" id="txtTypeId" /> 
                            </div>
                         </div>
                   
                     <%-- 添加局级考试的弹出层 --%>
                        <div id="popTable" class="layoutWarp" style="display: none; width: 400px; overflow: inherit;">
                            <div class="title">
                                <span id="formTitle">添加</span> <a title="关闭" onclick="return CloseMask('popTable')">
                                    关闭</a>
                            </div>
                            <table>
                                <tr style="height:35px;"><td>名称：</td><td><input type="text" id="txtTypeName" maxlength="20" /></td></tr>
                                <tr style="height:35px;">
                                    <td colspan="2">
                                        <input type="button" id="btnOK" value="确定"class="commonBut" onclick="AddType();" />
                                        <input type="button" id="btnCancel" value="取消" class="commonBut" onclick="return CloseMask('popTable')"/>
                                    </td>
                                </tr>
                            </table>  
                        </div>
                        
                         <%-- 添加局级考试的弹出层 --%>
                        <div id="popTable2" class="layoutWarp" style="display: none; width: 400px; overflow: inherit;">
                            <div class="title">
                                <span id="Span1">修改</span> <a title="关闭" onclick="return CloseMask('popTable2')">
                                    关闭</a>
                            </div>
                            <table>
                                <tr><td>名称：</td><td><input type="text" id="txtTypeName2" maxlength="20"/></td></tr>
                                <tr>
                                    <td colspan="2">
                                        <input type="button" id="Button1" value="确定"class="commonBut" onclick="UpdateType();" />
                                        <input type="button" id="Button2" value="取消" class="commonBut" onclick="return CloseMask('popTable2')"/>
                                    </td>
                                </tr>
                            </table>  
                        </div>
                </div>
            </div>
        </form>
    </div>
</body>
</html>

<script type="text/javascript">

  currHistoryId = <%=currHistoryId %>;
currCauseId = 1;
 
<%
    SetTypeArr();
   
 %> 
  
</script>
